<?php
$tags1="";
if (count($com1['Tag']) > 0) {
echo '<div class="tags1">';
  echo  ' <b>Tags:</b> <a href ="javascript:void(0)" onclick="return editTags(this)" class="moreless"> [Edit]</a><span class="tags2">';
            foreach ($com1['Tag'] as $tag) {
                 if (strpos($tag['tag'],"board:")!==false)
                     echo "<a class='boardLink' href='?search=".$tag['tag']."'>".$tag['tag']."</a>, ";
                 else if (strpos($tag['tag'],"test:")!==false)
                     echo "<a class='boardLink1' href='?search=".$tag['tag']."'>".$tag['tag']."</a>, ";
                 else
                     echo "<a href='?search=".$tag['tag']."' >".$tag['tag']."</a>, ";
                  $tags1.=$tag['tag']." ";
                  }
}
    else {
            echo "<a href='javascript:void(0);' onclick='return showTags(this);' style='font-size:10px;'>Tag me!</a>";
      }

      echo "<div class='search' style='display:none'>";
      echo '<form action="/urp/tags/add" method="post" accept-charset="utf-8">
        <input type="hidden" name="_method" value="POST" />
      <div class="input text" style="display:inline; clear:none;"><input type="hidden" name="data[Comment][id]" value="'.$com1['Comment']['id'].'"/>
          <input name="data[Tag][tag]" id="Tagtag" type="text" value="'.$tags1.'"class="search1"></div><div class="submit" style="display:inline; clear:none;">
          <input type="submit" value="Add Tags"></div></form>';
  
      echo "</div></div>";

?>